package org.tnaggs.project.model;

import java.sql.Time;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Game {

	private int gameID;
	private int homeTeamID;
	private int awayTeamID;
	private int locationID;
	private Date gameDate;
	private Time gameTime;
	private int homeScore;
	private int awayScore;
	
	public int getGameID() {
		return gameID;
	}
	
	public void setGameID(int gameID) {
		this.gameID = gameID;
	}
	
	public int getHomeTeamID() {
		return homeTeamID;
	}
	
	public void setHomeTeamID(int homeTeamID) {
		this.homeTeamID = homeTeamID;
	}
	
	public int getLocationID() {
		return locationID;
	}
	
	public void setLocationID(int locationID) {
		this.locationID = locationID;
	}
	
	public int getAwayTeamID() {
		return awayTeamID;
	}
	
	public void setAwayTeamID(int awayTeamID) {
		this.awayTeamID = awayTeamID;
	}
	
	public Date getGameDate() {
		return gameDate;
	}
	
	public void setGameDate(String date) {
		SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy hh:mm");
		try {
			this.gameDate = sdf.parse(date);
		} catch (ParseException e) {
			System.err.println("The date is not in a viable format.  Exception: " + e);
		}
	}
	
	public void setGameDate(Date gameDate) {
		this.gameDate = gameDate;
	}
	
	public int getHomeScore() {
		return homeScore;
	}
	
	public void setHomeScore(int homeScore) {
		this.homeScore = homeScore;
	}
	
	public int getAwayScore() {
		return awayScore;
	}
	
	public void setAwayScore(int awayScore) {
		this.awayScore = awayScore;
	}

	public Time getGameTime() {
		return gameTime;
	}

	public void setGameTime(Time gameTime) {
		this.gameTime = gameTime;
	}
	
}
